@namespace SwashbucklerDiary.Rcl.Components
@inherits MediaResourceListComponentBase

<div>
    <div class="adaptive-card-container">
        @foreach (var item in loadedItems)
        {
            <AudioResourceCard @key="item.ResourceUri"
                       Value="item"
                       OnMenu="OpenMenu">
            </AudioResourceCard>
        }
    </div>

    <MInfiniteScroll @ref="mInfiniteScroll"
                     Class="@InfiniteScrollClass"
                     OnLoad="@OnLoad"
                     Parent="@($"#{ScrollElementId}")"
                     EmptyText="@(string.Empty)"
                     LoadingText="@(string.Empty)">
        <LoadMoreContent Context="load">
            <MButton Icon="true"
                     OnClick="@load">
                <MIcon>refresh</MIcon>
            </MButton>
        </LoadMoreContent>
    </MInfiniteScroll>
</div>

<EmptyResult Show="Value.Count == 0"
             Text="@(I18n.T("No audio"))">
</EmptyResult>

<MultiMenu @bind-Visible="showMenu"
           DynamicListItems="menuItems"
           ActivatorAttributes="menuActivatorAttributes"
           MenuOffsetX
           MenuNudgeLeft="52"
           MenuNudgeBottom="24">
</MultiMenu>
